package com.chookss.view;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chookss.R;
import com.chookss.view.listener.ShareDialogListener;

import butterknife.BindView;


public class ShareCodeDialog extends BaseDialog {

    @BindView(R.id.tvCode)
    TextView tvCode;
    @BindView(R.id.tvCopyCode)
    TextView tvCopyCode;
    private Context context;

    private ShareDialogListener listener = null;
    public void ShareDialogListener(@NonNull Context context) {
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_share_view;
    }

    @Override
    protected void init(View view) {
        initCenter(0.3f);
        tvCopyCode.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                listener.onClick();
                dismiss();
            }
        });
    }

    public ShareCodeDialog(@NonNull Context context, String code, ShareDialogListener listener) {
        super(context);
        this.context = context;
        this.listener = listener;
        tvCode.setText(code);
    }


}